import URL from '@/config/url'
import utils from '@/utils/utils'

export default {
	// 获取装企主页信息
	getIndexInfo(params = {}){
		let data = {
			decoration_id:params.decoration_id
		}
		return utils.uniRequest({url:URL.BASE2 + '/decoration/Decoration/index',data})
	},
	// 装企设置详情
	getIndexDetail(params = {}){
		let data = {
			decoration_id:params.decoration_id
		}
		return utils.uniRequest({url:URL.BASE2 + '/decoration/Decoration/getDetail',data})
	},
	// 装企设置编辑
	toEditIndex(params = {}){
		let data = {
			decoration_id:params.decoration_id,
			title:params.title,
			avatar:params.avatar,
			back_thumb_url:params.back_thumb_url,
			sign:params.sign
		}
		return utils.uniRequest({url:URL.BASE2 + '/decoration/Decoration/edit',data})
	},
	// 获取装企评论列表
	getDecoraComment(params = {}){
		let data = {
			decoration_id:params.decoration_id,
			page:params.page,
			pagesize:params.pagesize
		}
		return utils.uniRequest({url:URL.BASE2 + '/decoration/Decoration/getCommentList',data})
	},
	// 企业评论删除
	delDecoraComment(params = {}){
		let data = {
			comment_id:params.comment_id
		}
		return utils.uniRequest({url:URL.BASE2 + '/decoration/Decoration/delComment',data})
	},
	
	// 获取设计订单列表
	getDesginOrder(params = {}){
		let data = {
			decoration_id:params.decoration_id,
			status:params.status,
			keyword:params.keyword,
			page:params.page,
			pagesize:params.pagesize
		}
		return utils.uniRequest({url:URL.BASE2 + '/decoration/DecorationOrder/getDesignOrderList',data})
	},
	// 获取设计订单详情
	desginOrderDetail(params = {}){
		let data = {
			id:params.id
		}
		return utils.uniRequest({url:URL.BASE2 + '/decoration/DecorationOrder/getDesignOrderDetail',data})
	},
	
	// 获取施工订单列表
	getBuildOrder(params = {}){
		let data = {
			decoration_id:params.decoration_id,
			status:params.status,
			keyword:params.keyword,
			page:params.page,
			pagesize:params.pagesize
		}
		return utils.uniRequest({url:URL.BASE2 + '/decoration/DecorationOrder/getBuildOrderList',data})
	},
	// 获取施工订单详情
	buildOrderDetail(params = {}){
		let data = {
			id:params.id
		}
		return utils.uniRequest({url:URL.BASE2 + '/decoration/DecorationOrder/getBuildOrderDetail',data})
	},
	// 装企施工团队
	getStaffList(params = {}){
		let data = {
			decoration_id:params.decoration_id
		}
		return utils.uniRequest({url:URL.BASE2 + '/decoration/Builder/getList',data})
	},
	
	// 获取装企案例列表(设计与施工)
	getDecorationCase(params = {}){
		let data = {
			decoration_id:params.decoration_id,
			keyword:params.keyword,
			style:params.style,
			area:params.area,
			offer:params.offer,
			page:params.page,
			pagesize:params.pagesize
		}
		let url = params.type=='desgin'?'/decoration/DecorationCase/getDesignCaseList':'/decoration/DecorationCase/getBuildCaseList';
		return utils.uniRequest({url:URL.BASE2 + url,data})
	},
	// 删除装企案例
	delDecorationCase(params = {}){
		let data = {
			id:params.id
		}
		let url = params.type == 'desgin'?'/decoration/DecorationCase/delDesignCase':'/decoration/DecorationCase/delBuildCase';
		return utils.uniRequest({url:URL.BASE2 + url,data})
	},
	
	// 获取装企案例详情
	getDecorationDetail(params = {}){
		let data = {
			id:params.id
		}
		let url = params.type=='desgin'?'/decoration/DecorationCase/getDesignCaseDetail':'/decoration/DecorationCase/getBuildCaseDetail';
		return utils.uniRequest({url:URL.BASE2 + url,data})
	},
	// 获取案例评论列表(设计案例)
	getCommentList(params = {}){
		let data = {
			case_id:params.case_id,
			page:params.page,
			pagesize:params.pagesize
		}
		let url = params.type == 'desgin'?'/designer/DesignCase/getCommentList':'/builder/BuildCase/getCommentList';
		return utils.uniRequest({url:URL.BASE2 + url,data})
	},
	// 获取案例转发列表(设计案例)
	getForwardList(params = {}){
		let data = {
			case_id:params.case_id,
			page:params.page,
			pagesize:params.pagesize
		}
		let url = params.type == "desgin"?'/designer/DesignCase/getForwardList':'/builder/BuildCase/getForwardList';
		return utils.uniRequest({url:URL.BASE2 + url,data})
	},
	// 获取案例点赞列表(设计案例)
	getSupportList(params = {}){
		let data = {
			case_id:params.case_id,
			page:params.page,
			pagesize:params.pagesize
		}
		let url = params.type == 'desgin'?'/designer/DesignCase/getSupportList':'/builder/BuildCase/getSupportList';
		return utils.uniRequest({url:URL.BASE2 + url,data})
	},
	
	// 案例评论(设计案例)
	toCaseAsk(params = {}){
		let data = {
			user_id:params.user_id,
			case_id:params.case_id,
			content:params.content
		}
		let url = params.type == 'desgin'?'/designer/DesignCase/comment':'/builder/BuildCase/comment';
		return utils.uniRequest({url:URL.BASE2 + url,data})
	},
	// 案例评论回复(设计案例)
	toCaseReply(params = {}){
		let data = {
			user_id:params.user_id,
			comment_id:params.comment_id,
			content:params.content
		}
		let url = params.type == 'desgin'?'/designer/DesignCase/reply':'/builder/BuildCase/reply';
		return utils.uniRequest({url:URL.BASE2 + url,data})
	},
	// 案例评论删除(设计案例)
	delCaseComment(params = {}){
		let data = {
			comment_id:params.comment_id
		}
		let url = params.type == 'desgin'?'/designer/DesignCase/delComment':'/builder/BuildCase/delComment';
		return utils.uniRequest({url:URL.BASE2 + url,data})
	}
}